﻿using System;
using System.Threading;
using System.Windows.Forms;
using FastNET.CleanAct.Common.EngineModel.SplashSystem;
using FastNET.CleanAct.Tools.HomeTemplateEditor.Forms;

namespace FastNET.CleanAct.Tools.HomeTemplateEditor
{
    static class Program
    {
        private static SplashScreenContext context;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [MTAThread]
        static void Main(string[] args)
        {
            context = new SplashScreenContext { MinimumSplashDuration = 2000 };
            try
            {
                context.Run(args, typeof(SplashForm), ApplicationInit, UIInit);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.InnerException.Message);
            }
        }

        static void ApplicationInit(string[] args, SafeSendMessageCallback messageCallback)
        {
            messageCallback("Initializing Application");
            Thread.Sleep(200);
            messageCallback("Processing Command Line Arguments");
            Thread.Sleep(200);


            messageCallback("Application Initialized");
        }

        static Form UIInit(string[] args,
            SafeSendMessageCallback messageCallback)
        {
            messageCallback("Initializing User Interface");
            Thread.Sleep(200);
            messageCallback("User Interface Initialized");
            return new HomeBox();
        }
    }
}
